{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": 53,
  "iteration": 1708330138680,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ds_prometheus}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "right",
            "displayMode": "auto",
            "inspect": false
          },
          "decimals": 2,
          "displayName": "",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 75
              },
              {
                "color": "red",
                "value": 96
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Usage"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "color-background-solid"
              },
              {
                "id": "decimals",
                "value": 0
              },
              {
                "id": "unit",
                "value": "percent"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Pool"
            },
            "properties": [
              {
                "id": "links",
                "value": [
                  {
                    "targetBlank": true,
                    "title": "Pool detail",
                    "url": "/d/sZzUB4ymk3/?var-ds_prometheus=${ds_prometheus}&var-pool=${__value.raw}&${__url_time_range}"
                  }
                ]
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Used"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 0
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Total"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 0
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 18,
        "x": 0,
        "y": 0
      },
      "id": 798,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "editorMode": "code",
          "expr": "metallb_allocator_addresses_total",
          "format": "table",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "editorMode": "code",
          "expr": "metallb_allocator_addresses_in_use_total",
          "format": "table",
          "hide": false,
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Pools",
      "transformations": [
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "pool"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time 1": true,
              "Time 2": true,
              "__name__ 1": true,
              "__name__ 2": true,
              "container 1": true,
              "container 2": true,
              "instance 1": true,
              "instance 2": true,
              "job 1": true,
              "job 2": true,
              "namespace 1": true,
              "namespace 2": true,
              "pod 1": true,
              "pod 2": true,
              "tier 1": true,
              "tier 2": true
            },
            "indexByName": {
              "Time 1": 1,
              "Time 2": 9,
              "Value #A": 18,
              "Value #B": 17,
              "__name__ 1": 2,
              "__name__ 2": 10,
              "container 1": 3,
              "container 2": 11,
              "instance 1": 4,
              "instance 2": 12,
              "job 1": 5,
              "job 2": 13,
              "namespace 1": 6,
              "namespace 2": 14,
              "pod 1": 7,
              "pod 2": 15,
              "pool": 0,
              "tier 1": 8,
              "tier 2": 16
            },
            "renameByName": {
              "Time 1": "",
              "Value #A": "Total",
              "Value #B": "Used",
              "instance 2": "",
              "job 2": "",
              "pool": "Pool",
              "tier 1": "",
              "tier 2": ""
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "UsageAbs",
            "binary": {
              "left": "Used",
              "operator": "/",
              "reducer": "sum",
              "right": "Total"
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "Usage",
            "binary": {
              "left": "UsageAbs",
              "operator": "*",
              "reducer": "sum",
              "right": "100"
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "Pool",
                "Used",
                "Total",
                "Usage"
              ]
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ds_prometheus}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 76
              },
              {
                "color": "red",
                "value": 96
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 800,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "expr": "metallb_allocator_addresses_in_use_total / metallb_allocator_addresses_total * 100",
          "refId": "A"
        }
      ],
      "title": "Pools usage (Total)",
      "type": "gauge"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${ds_prometheus}"
      },
      "description": "",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.5.13",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "editorMode": "code",
          "expr": "metallb_allocator_addresses_total",
          "instant": false,
          "interval": "",
          "legendFormat": "Total addresses in pool: {{pool}}",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "editorMode": "code",
          "expr": "metallb_allocator_addresses_in_use_total",
          "interval": "",
          "legendFormat": "Used addresses in pool: {{pool}}",
          "range": true,
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Pools usage (Total)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${ds_prometheus}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 15
      },
      "id": 796,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "editorMode": "builder",
          "exemplar": false,
          "expr": "sum by(pod, ip, node) (metallb_speaker_announced)",
          "format": "table",
          "instant": false,
          "legendFormat": "",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Announced by speakers",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Value": {
                "aggregations": []
              },
              "ip": {
                "aggregations": [],
                "operation": "groupby"
              },
              "node": {
                "aggregations": [],
                "operation": "groupby"
              },
              "pod": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 23
      },
      "id": 804,
      "panels": [
        {
          "cards": {
            "cardHSpacing": 2,
            "cardMinWidth": 5,
            "cardVSpacing": 2
          },
          "color": {
            "cardColor": "#b4ff00",
            "colorScale": "sqrt",
            "colorScheme": "interpolateGnYlRd",
            "defaultColor": "#757575",
            "exponent": 0.5,
            "mode": "discrete",
            "thresholds": [
              {
                "$$hashKey": "object:96",
                "color": "#E02F44",
                "tooltip": "Session is not established",
                "value": "0"
              },
              {
                "$$hashKey": "object:100",
                "color": "#56A64B",
                "tooltip": "Session is established",
                "value": "1"
              }
            ]
          },
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "gridPos": {
            "h": 8,
            "w": 24,
            "x": 0,
            "y": 24
          },
          "hideBranding": false,
          "highlightCards": true,
          "id": 806,
          "legend": {
            "show": true
          },
          "nullPointMode": "as empty",
          "pageSize": 15,
          "seriesFilterIndex": -1,
          "statusmap": {
            "ConfigVersion": "v1"
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ds_prometheus}"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "metallb_bgp_session_up",
              "format": "time_series",
              "instant": false,
              "legendFormat": "{{pod}}->{{peer}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Sessions",
          "tooltip": {
            "extraInfo": "",
            "freezeOnClick": true,
            "items": [],
            "show": true,
            "showExtraInfo": false,
            "showItems": false
          },
          "transformations": [],
          "type": "flant-statusmap-panel",
          "useMax": true,
          "usingPagination": false,
          "xAxis": {
            "show": true
          },
          "yAxis": {
            "maxWidth": -1,
            "minWidth": -1,
            "show": true
          },
          "yAxisSort": "metrics",
          "yLabel": {
            "delimiter": "",
            "labelTemplate": "",
            "usingSplitLabel": false
          }
        }
      ],
      "title": "BGP",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 24
      },
      "id": 802,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {
            "type": "prometheus",
            "uid": "${ds_prometheus}"
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 25
          },
          "hiddenSeries": false,
          "id": 6,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "8.5.13",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ds_prometheus}"
              },
              "expr": "rate(metallb_layer2_gratuitous_sent{instance=~\"$layer2instance\"}[5m])",
              "hide": false,
              "instant": false,
              "interval": "",
              "legendFormat": "gratuitous_sent instance={{instance}} ip={{ip}} ",
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ds_prometheus}"
              },
              "expr": "rate(metallb_layer2_requests_received{instance=~\"$layer2instance\"}[5m])",
              "hide": false,
              "interval": "",
              "legendFormat": "requests_received instance={{instance}} ip={{ip}} ",
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${ds_prometheus}"
              },
              "expr": "rate(metallb_layer2_responses_sent{instance=~\"$layer2instance\"}[5m])",
              "hide": false,
              "interval": "",
              "legendFormat": "responses_sent instance={{instance}} ip={{ip}} ",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "ARP packets",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "logBase": 1,
              "show": true
            },
            {
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        }
      ],
      "title": "L2",
      "type": "row"
    }
  ],
  "refresh": "",
  "schemaVersion": 36,
  "style": "dark",
  "tags": [
    "main"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "main",
          "value": "main"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Prometheus",
        "multi": false,
        "name": "ds_prometheus",
        "options": [],
        "query": "prometheus",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": true,
          "text": [
            "All"
          ],
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${ds_prometheus}"
        },
        "definition": "label_values(metallb_layer2_gratuitous_sent,instance)",
        "hide": 0,
        "includeAll": true,
        "label": "Layer 2 instance",
        "multi": true,
        "name": "layer2instance",
        "options": [],
        "query": {
          "query": "label_values(metallb_layer2_gratuitous_sent,instance)",
          "refId": "main-layer2instance-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Metallb",
  "uid": "sZzUB4ymk2",
  "version": 2,
  "weekStart": ""
}
